Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / core / ui / src / commonMain / kotlin / org / meshtastic / core / ui / util / PlatformUtils.kt

Displaying Raw • Download

core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/util/PlatformUtils.kt 7a0915ebe99a4704e871fa5711964def956af182 (7a0915eb) Text, 4.24 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tf0883e@fileTb4b4b4:Te6edf3SuppressTb4b4b4(Ta5d6ff"Ta5d6ffTooManyFunctionsTa5d6ff"Tb4b4b4)

Tff7b72package T7ee787org.meshtastic.core.ui.util

Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787org.jetbrains.compose.resources.StringResource
Tff7b72import T7ee787org.meshtastic.core.common.util.CommonUri

T8b949e/** Returns a function to open the platform's NFC settings. */
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffrememberOpenNfcSettingsTb4b4b4(Tb4b4b4)Tb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/** Returns a function to show a toast message. */
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffrememberShowToastTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3suspend Tb4b4b4(Tffa657StringTb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/** Returns a function to show a toast message from a string resource. */
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffrememberShowToastResourceTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3suspend Tb4b4b4(Te6edf3StringResourceTb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/** Returns a function to open the platform's map application at the given coordinates. */
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffrememberOpenMapTb4b4b4(Tb4b4b4)Tb4b4b4: Tb4b4b4(Te6edf3latitudeTb4b4b4: Tffa657DoubleTb4b4b4, Te6edf3longitudeTb4b4b4: Tffa657DoubleTb4b4b4, Te6edf3labelTb4b4b4: Tffa657StringTb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/** Returns a function to open the platform's browser with the given URL. */
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffrememberOpenUrlTb4b4b4(Tb4b4b4)Tb4b4b4: Tb4b4b4(Te6edf3urlTb4b4b4: Tffa657StringTb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/** Returns a launcher function to prompt the user to save a file. The callback receives the saved file URI. */
Tf0883e@Composable
Tff7b72expect Tff7b72fun Td2a8ffrememberSaveFileLauncherTb4b4b4(
Te6edf3onUriReceivedTb4b4b4: Tb4b4b4(Te6edf3CommonUriTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Tb4b4b4)Tb4b4b4: Tb4b4b4(Te6edf3defaultFilenameTb4b4b4: Tffa657StringTb4b4b4, Te6edf3mimeTypeTb4b4b4: Tffa657StringTb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/** Returns a launcher function to prompt the user to open/pick a file. The callback receives the selected file URI. */
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffrememberOpenFileLauncherTb4b4b4(Te6edf3onUriReceivedTb4b4b4: Tb4b4b4(Te6edf3CommonUri?Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4)Tb4b4b4: Tb4b4b4(Te6edf3mimeTypeTb4b4b4: Tffa657StringTb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/**
* Returns a suspend function that reads up to [maxChars] characters of text from a [CommonUri]. Returns `null` if the
* file is empty or cannot be read.
*/
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffrememberReadTextFromUriTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3suspend Tb4b4b4(Te6edf3uriTb4b4b4: Te6edf3CommonUriTb4b4b4, Te6edf3maxCharsTb4b4b4: Tffa657IntTb4b4b4) Tff7b72-Tff7b72> Tffa657String?

T8b949e/** Keeps the screen awake while [enabled] is true. No-op on platforms that don't support it. */
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffKeepScreenOnTb4b4b4(Te6edf3enabledTb4b4b4: Tffa657BooleanTb4b4b4)

T8b949e/** Returns a launcher to request location permissions. */
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffrememberRequestLocationPermissionTb4b4b4(Te6edf3onGrantedTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4, Te6edf3onDeniedTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit Tff7b72= Tb4b4b4{Tb4b4b4}Tb4b4b4)Tb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/** Returns a launcher to open the platform's location settings. */
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffrememberOpenLocationSettingsTb4b4b4(Tb4b4b4)Tb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/** Returns a launcher to request Bluetooth scan + connect permissions. No-op on platforms without runtime BLE perms. */
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffrememberRequestBluetoothPermissionTb4b4b4(Te6edf3onGrantedTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4, Te6edf3onDeniedTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit Tff7b72= Tb4b4b4{Tb4b4b4}Tb4b4b4)Tb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/** Returns a launcher to request the ACCESS_LOCAL_NETWORK permission. No-op on platforms that don't require it. */
Tf0883e@Composable
Tff7b72expect Tff7b72fun Td2a8ffrememberRequestLocalNetworkPermissionTb4b4b4(Te6edf3onGrantedTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4, Te6edf3onDeniedTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit Tff7b72= Tb4b4b4{Tb4b4b4}Tb4b4b4)Tb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/**
* Returns whether ACCESS_LOCAL_NETWORK is currently granted. Always `true` on platforms / API levels that don't gate
* local-network access behind a runtime permission.
*/
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffisLocalNetworkPermissionGrantedTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657Boolean

T8b949e/** Returns a launcher to request the POST_NOTIFICATIONS permission. No-op on platforms that don't require it. */
Tf0883e@Composable
Tff7b72expect Tff7b72fun Td2a8ffrememberRequestNotificationPermissionTb4b4b4(Te6edf3onGrantedTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4, Te6edf3onDeniedTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit Tff7b72= Tb4b4b4{Tb4b4b4}Tb4b4b4)Tb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit

T8b949e/**
* Returns whether location permissions are currently granted. Always `true` on platforms without runtime permissions.
*/
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffisLocationPermissionGrantedTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657Boolean

T8b949e/**
* Returns whether GPS/location services are currently disabled at the system level. Always `false` on platforms where
* this concept doesn't apply.
*/
Tf0883e@Composable Tff7b72expect Tff7b72fun Td2a8ffisGpsDisabledTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657Boolean

Served by rngit 1.5.0 - Generated in 0.05s